package com.lxl.view;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;

import com.lxl.main.Main;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Font;
import java.awt.Cursor;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 * @author 刘星鹭 
 * @Email liuxinglumail@163.com
 * @version 创建时间： 2014年9月12日 下午2:52:25
 */

public class ManagerView extends JFrame {
	
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;

	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ManagerView frame = new ManagerView();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	
	public ManagerView() {
		addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent arg0) {
				Main.main(new String[1]);
			}
		});
		setFont(new Font("微软雅黑", Font.PLAIN, 12));
		setTitle("图书管理系统");		
		setBounds(100, 100, 450, 143);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton button = new JButton("用户列表");
		button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		button.setFont(new Font("微软雅黑", Font.PLAIN, 12));
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		button.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				ViewBookUser.main(new String[1]);
				dispose();
			}
		});
		button.setBounds(10, 28, 132, 47);
		contentPane.add(button);
		
		JButton button_1 = new JButton("图书列表");
		button_1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		button_1.setFont(new Font("微软雅黑", Font.PLAIN, 12));
		button_1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				ViewBook.main(new String[1]);
				dispose();
			}
		});
		button_1.setBounds(152, 28, 134, 47);
		contentPane.add(button_1);
		
		JButton button_2 = new JButton("图书分类列表");
		button_2.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		button_2.setFont(new Font("微软雅黑", Font.PLAIN, 12));
		button_2.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				ViewBookClassify.main(new String[1]);
				dispose();
			}
		});
		button_2.setBounds(296, 28, 128, 47);
		contentPane.add(button_2);
	}
}
